import { configureStore } from '@reduxjs/toolkit'
import { thunk } from 'redux-thunk'
import reduxLogger from 'redux-logger'
import reduxPromise from 'redux-promise'
import taskSliceReducer from './features/taskSlices'
const store = configureStore({
    //指定reducer
    reducer: {
        //按模块管理各个切片
        task: taskSliceReducer
    },
    //使用中间件[如果我们不指定任何中间件，则默认集成了reduxThunk;但是一旦设置，会整体替换默认值，需要手动指定thunk中间件]
    middleware: ()=>{
        return [thunk, reduxLogger, reduxPromise]
    }
})

export default store